#include <iostream>
#include <vector>
using namespace std;

void solve(vector<int>&v,int total)
{
    vector<int>dp(total+1,0x3f3f3f3f);
    dp[0] = 0;
    for(int i = 1;i<=total;++i)
    {
        for(int coin:v)
        {
            if(i-coin>=0)
            {
                dp[i] = min(dp[i],dp[i-coin]+1);
            }
        }
    }
    if(dp[total] == 0x3f3f3f3f)
    {
        cout<<-1;
    }
    else
    {
        cout<<dp[total];
    }
}

int main()
{
    vector<int> v({33,24,12,5,1});
    cout<<"Types of change"<<endl;
    for(int coin:v)
    {
        cout<<coin<<' ';
    }
    cout<<endl;
    int total = 0;
    cout<<"input:"<<endl;
    cin>>total;
    solve(v,total);
    cout<<endl;
    return 0;
}
